package com.shop.service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.shop.entity.BulkReturnDetail;
import com.shop.mapper.BulkReturnDetailMapper;
import com.shop.model.PageParam;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
@AllArgsConstructor
public class BulkReturnDetailService {
    private final BulkReturnDetailMapper bulkReturnDetailMapper;

    /**
     * @author clh
     * @description 分页
     * @date  2020/11/30 19:40
     * @param pageParam
     * @return {@link PageInfo}
     **/
    public PageInfo searchSomeByPageDetail(PageParam<BulkReturnDetail> pageParam){
        PageHelper.startPage(pageParam.getPageNum(),pageParam.getPageSize());

        List<BulkReturnDetail> returnDetailList = bulkReturnDetailMapper.searchSomeByPageDetail(pageParam.getModel());
        PageInfo<BulkReturnDetail> pageInfo = new PageInfo<>(returnDetailList);

        return pageInfo;
    }

}
